const express = require('express');
const router = express.Router();
const categoryController = require('../controllers/categoryController');
const { verifyToken } = require('../middleware/authMiddleware');

// 所有路由都需要认证
router.use(verifyToken);

// 创建协议分类
router.post('/', categoryController.createCategory);

// 获取用户的所有分类
router.get('/', categoryController.getUserCategories);

// 获取分类详情
router.get('/:id', categoryController.getCategoryById);

// 更新分类
router.put('/:id', categoryController.updateCategory);

// 删除分类
router.delete('/:id', categoryController.deleteCategory);

module.exports = router;
